<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        var reg = new RegExp("a");
        var str1 = "qianguyihao";
        var str2 = "smyh";
        console.log(reg.test(str1));
        console.log(reg.test(str2));
    </script>
</body>

</html>